//
//  YJMUserModel.swift
//  Weibo
//
//  Created by 杨军民 on 16/7/25.
//  Copyright © 2016年 杨军民. All rights reserved.
//

import UIKit

//用户模型
class YJMUserModel: NSObject {
    
    ///用户UID
    var id : Int64 = 0
    
    ///用户的昵称
    var screen_name : String?
    
    ///用户头像地址
    var profile_image_url : String?
    
    ///认证
    var verified_type : Int = -1
    
    ///会员等级
    var mbrank : Int = 0
    
    ///字典转模型
    init(dic: [String: AnyObject] ) {
        super.init()
        //kvc
        setValuesForKeysWithDictionary(dic)
    }
    
    //当获取到网络数据又没有全部用完会导致系统崩溃
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
        print("无需做任何事情")
    }
    
    //打印
    override var description: String {
        get{
            let key = ["id","screen_name","profile_image_url","verified_type","mbrank"]
            return "\n\n模型数据" + dictionaryWithValuesForKeys(key).description
        }
    }
    
}
